<?php

namespace Respect\Http\Module;

use Respect\Http\Bootstrappable;
use Respect\Environment\EnvironmentableInterface;
use ArrayObject;

class Head extends ArrayObject implements Bootstrappable
{

    public static function qualify(EnvironmentableInterface $env)
    {
        return $env['REQUEST_METHOD'] === 'HEAD' ? new static($env) : false;
    }

    public function __construct(EnvironmentableInterface $env)
    {
        parse_str($env['QUERY_STRING'], $getData);
        parent::__construct($getData, ArrayObject::ARRAY_AS_PROPS);
    }

}